home *** CD-ROM | disk | FTP | other *** search
- ***********************************************************************
- * PROCEDURE DialModem - Illustrate the basic technique for dialing a
- * phone number through a modem using the FoxPro low-level file
- * input/output functions. No error checking.
- ***********************************************************************
- PROCEDURE DialModem
- PARAMETERS Comport, Phonenum
- PRIVATE Modem
- Modem = FOPEN(Comport,2) && Open port for read/write access
-
- =FPUTS(Modem, 'ATDT'+Phonenum) && Dial the modem
-
- DO msgwin WITH "Lift handset while ringing, press any key when connected",;
- "","Press any key or click on the mouse now to cancel",;
- "Dialing: "+phonenum+" on "+Comport
-
- =FPUTS(Modem, '+++ATH0') && Hang-up command
-
- =FCLOSE(Modem) && Close the port
-
- RETURN
-
- ***********************************************************************
- * PROCEDURE msgwin - Displays some messages in a window and waits for
- * a keypress or mouse click
- ***********************************************************************
- PROCEDURE msgwin && Display window to user
- PARAMETER text, text1, text2, text3
- PRIVATE xx, xy, xxx, xyy
- xx = (SROWS() - 6)/2
- xy = (SCOLS() - 60)/2
- xxx = xx + 6
- xyy = xy + 61
-
- DEFINE WINDOW msgwin FROM xx,xy TO xxx,xyy TITLE '&text3'
- ACTIVATE WINDOW msgwin
- @ 1, (60 - LEN(text))/2 SAY text
- @ 2, (60 - LEN(text1))/2 SAY text1
- @ 4, (60 - LEN(text2))/2 SAY text2
- =INKEY(0,'HM') && wait for keypress or mouse click
- RELEASE WINDOW msgwin
- RETURN